﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<style type="text/css">
	.table_box_style{ width:614px; margin:20px auto; line-height:20px;}
	.table_box_style h4{ line-height:24px; font-size:14px; font-weight:700;}
	.table_box_style table { width:100%;}
	.table_box_style table td{ border:1px solid #EFEFEF; padding:5px;}
</style>

<div class="w_980">
	<!--back_box-->
	<div class="back_box clearfix">
        <% 
            DAL.Service.ILibraryBookIndentService lbi = new DAL.Service.Impl.LibraryBookIndentServiceImpl();
            DAL.Service.IUserInfoService userOper = new DAL.Service.Impl.UserInfoServiceImpl();
            DomainModel.UserInfo user = (DomainModel.UserInfo)Session["user"];
            Html.RenderPartial("~/Views/Shared/VipCenterList.ascx");
        %>
    	<!--right-->
        <div class="back_main">
        	<h3>基本信息</h3>
            <div class="top_info_box">
            	<ul>
                <%
                    int booksCount = lbi.getUserHaveBooks(user.u_id); //查询当前手持书本量    
                %>
                	<li><span>图书手持量：</span><%=booksCount %>本</li>
                </ul>
            </div>
            <%
                BIZ.BookOper boper = new BIZ.BookOper();
                IList li = boper.userGetRemind(user.u_id);
                if (li.Count > 0)
                {
            %>
            <div class="table_box_style">
	            <h2 class="li_bg">以下书籍即将到期或已经到期，请记得及时归还</h2>
                <table>
    	            <tbody>
                <tr>
                <td>书名</td>
                <td>借书时间</td>
                <td>应归还时间</td>
                </tr>
                    <%
                    foreach (Hashtable tb in li)
                    { 
                    %>
                    <tr><td><%=tb["lb_bookName"]%></td><td><%=tb["lbi_time"]%></td><td><%=tb["return_time"]%></td></tr>
                    <%
                    } 
                    %>
                    </tbody>
                </table>
            </div>
            <% 
                }

                IList liC = userOper.getUserCardList(user.u_id);
                if (liC.Count > 0)
                {
            %>
           <div class="table_box_style">
	            <h2 class="li_bg">会员卡充值记录</h2>
                <table>
    	            <tbody>
                <tr>
                 <td>卡号</td>
                 <td>卡类型</td>
                 <td>使用状态</td>
                 <td>生效时间</td>
                 <td>过期时间</td>
                 <td>借阅次数</td>
                </tr>
                    <%
                    foreach (Hashtable tb in liC)
                    { 
                    %>
                    <tr>
                        <td><%=tb["uc_card"]%></td>
                        <td><%=Enum.GetName(typeof(DAL.Enums.cardType), int.Parse(tb["uc_chargemode"].ToString()))%></td>
                        <td><%=Enum.GetName(typeof(DAL.Enums.cardstate), int.Parse(tb["uc_state"].ToString()))%></td>
                        <td><%=tb["c_starttime"]%></td>
                        <td><%=tb["c_endtime"]%></td>
                        <td><%=tb["usedTimes"]%></td>
                    </tr>
                    <%
                    } 
                    %>
                    </tbody>
                </table>
            </div>
            <% 
                }    
            %>
            <div class="main_info_box">
            	<ul>
                <%
                    DomainModel.UserInfo ui = (DomainModel.UserInfo)Session["user"];
                    bool li_bg = true;
                    if (ui.u_name != null && ui.u_name.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>中文名：</span><%=ui.u_name%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_enName != null && ui.u_enName.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>英文名：</span><%=ui.u_enName%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_papers != null && ui.u_papers.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>有效证件号：</span><%=ui.u_papers%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_birthday != null)
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>出生日期：</span><%=DateTime.Parse(ui.u_birthday.ToString()).ToString("yyyy-MM-dd")%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_sex != null)
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>性别：</span><%=(ui.u_sex==0?"男":"女")%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_school != null && ui.u_school.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>在读学校：</span><%=ui.u_school%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_class != null && ui.u_class.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>在读班级：</span><%=ui.u_class%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                </ul>
            	<ul>
                <%
                    if (ui.u_patriarchName1 != null && ui.u_patriarchName1.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>家长1姓名：</span><%=ui.u_patriarchName1%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_raletion1 != null && ui.u_raletion1.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>家长1与学员关系：</span><%=ui.u_raletion1%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_tel1 != null && ui.u_tel1.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>联系电话1：</span><%=ui.u_tel1%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_patriarchAge1 != null)
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>家长1年龄：</span><%=ui.u_patriarchAge1%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_patriarchEducation1 != null && ui.u_patriarchEducation1.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>家长1学历：</span><%=ui.u_patriarchEducation1%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_job1 != null && ui.u_job1.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>家长1从事行业：</span><%=ui.u_job1%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_post1 != null && ui.u_post1.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>家长1职位：</span><%=ui.u_post1%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                </ul>
            	<ul>
                <%
                    if (ui.u_patriarchName2 != null && ui.u_patriarchName2.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>家长2姓名：</span><%=ui.u_patriarchName2%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_raletion2 != null && ui.u_raletion2.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>家长2与学员关系：</span><%=ui.u_raletion2%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_tel2 != null && ui.u_tel2.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>联系电话2：</span><%=ui.u_tel2%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_patriarchAge2 != null)
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>家长2年龄：</span><%=ui.u_patriarchAge2%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_patriarchEducation2 != null && ui.u_patriarchEducation2.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>家长2学历：</span><%=ui.u_patriarchEducation2%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_job2 != null && ui.u_job2.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>家长2从事行业：</span><%=ui.u_job2%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_post2 != null && ui.u_post2.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>家长2职位：</span><%=ui.u_post2%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                </ul>
            	<ul>
                <%
                    if (ui.u_address != null && ui.u_address.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>住址：</span><%=ui.u_address%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                <%
                    if (ui.u_email != null && ui.u_email.Trim() != "")
                    {    
                %>
                	<li <%=(li_bg ? "class='li_bg'" : "") %>><span>邮箱地址：</span><%=ui.u_email%></li>
                    
                <% 
                        li_bg = !li_bg;
                    }
                %>
                </ul>
            </div>
        </div>
    </div>
</div>


</asp:Content>
